﻿using System.Web.UI.WebControls;
using System.Data.OleDb;
using System.Configuration;
using System.Data;
using System;


namespace AlGridDemo
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                OleDbConnection sqlConn = null;
                OleDbCommand sqlCmd = null;
                String strConnection = ConfigurationSettings.AppSettings["ConnectionString"];
                sqlConn = new OleDbConnection(strConnection);
                sqlCmd = new OleDbCommand("SELECT top 30 * FROM Customers", sqlConn);
                sqlConn.Open();
                OleDbDataAdapter ad = new OleDbDataAdapter(sqlCmd);
                DataSet ds = new DataSet();

                ad.Fill(ds);

                this.AlGrid1.DataSource = ds.Tables[0];
                this.AlGrid1.DataBind();
                sqlConn.Close();
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
    }
}